using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShootThemUp.Sources.PlayerInputs.WindowsPhone;
using ShootThemUp.Sources.AudioElements;

namespace ShootThemUp.Sources.Configuration
{
    /// <summary>
    /// This class contains the player configuration, ie the options which the player had choosen in the option screen.
    /// It's a singleton.
    /// </summary>
    public class PlayerConfiguration
    {

        #region Singleton

        /// <summary>
        /// The singleton.
        /// </summary>
        private static PlayerConfiguration instance;

        /// <summary>
        /// Private constructor, to permit the singleton.
        /// </summary>
        private PlayerConfiguration() { }
        
        /// <summary>
        /// Gets the instance of this singleton.
        /// </summary>
        public static PlayerConfiguration Instance
        {
            get
            {
                if (instance == null)
                    instance = new PlayerConfiguration();
                
                return instance;
            }
        }

        #endregion

        #region Static Fields & Properties

        private static MovementType movementType = MovementType.Accelerometer;
        private static bool autoShot = true;
        private static ExtraSong song = ExtraSong.Default;
        private static bool soundEffect = true;

        //This properties are public static because there are configuration fields, so they have to be accessible in all the program.

        /// <summary>
        /// Gets or sets a value indicating whether [auto shot].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [auto shot]; otherwise, <c>false</c>.
        /// </value>
        public static bool AutoShot
        {
            get { return autoShot; }
            set { autoShot = value; }
        }

        /// <summary>
        /// Gets or sets the type of the movement.
        /// </summary>
        /// <value>
        /// The type of the movement.
        /// </value>
        public static MovementType MovementType
        {
            get { return movementType; }
            set { movementType = value; }
        }

        /// <summary>
        /// Gets or sets the song to play.
        /// </summary>
        /// <value>
        /// The song to play.
        /// </value>
        public static ExtraSong Song
        {
            get { return song; }
            set { song = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating if there are sound effect.
        /// </summary>
        /// <value>
        ///   <c>true</c> if [sound effect]; otherwise, <c>false</c>.
        /// </value>
        public static bool SoundEffect
        {
            get { return soundEffect; }
            set { soundEffect = value; }
        }

        #endregion
    }
}
